package com.itheima.request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/shanji")
public class ShanJiServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("乌鸦发起请求找山鸡(赵山河)"+request+"  "+response.hashCode());

        System.out.println("山鸡发现，我赛，钱都泡澡了，没钱了 咋办，不能丢面");
        System.out.println("乌鸦这个人比较狠，如果不给他钱，他就掀桌子！");
        double money = 5.0;
        // 把钱存到 request域对象中
        request.setAttribute("money",money);
        //想到大哥了 要找到大哥
        //  要找谁    干什么呢     找浩南  来帮我处理这次请求和响应
        //                   需要把这次的请求响应 转发给 浩南
        request.getRequestDispatcher("/haonan").forward(request,response);

    }
}
